#ifndef __MQTT_H__
#define __MQTT_H__

#include "stdlib.h"
#include "stdint.h"

typedef struct{

  unsigned char user_name[50];
  unsigned char passwd[50];
	uint16_t port;
	uint8_t IP[4];
	
	unsigned char Subscribed_topic[10][100];
	unsigned char Published_topic[10][100];

}MQTT_Config_t;

extern MQTT_Config_t mqtt_config;


uint8_t Transport_Open(void);

uint8_t Transport_Close(void);



void MQTT_Connect(char *username, char *password);
void MQTT_Subscribe( char *topic,int req_qos);
void MQTT_Unsubscribe(char *topic);
void MQTT_Publish(char *topic, int qos, char *payload);
void MQTT_Pingreq(void);
void MQTT_Disconnect(void);
void msgDeal(unsigned char *msg, int len);






#endif